import Vue from 'vue'
import VueRouter from 'vue-router'
import NewsList from '../components/news-list'
import Start from '../components/start'
import HotNews from '../components/hot-news'
import cateNews from '../components/cate-news'
import newsHeader from '../components/news-header'
import newsDetail from '../components/news-detail'
import Comments from '../components/comments'
import Editors from '../components/editors'
import EditorDetail from '../components/editor-detail'
import Recommenders from '../components/recommenders'

Vue.use(VueRouter)

const routes = [
  {path: '/', component: Start},
  {
    path: '/home',
    component: NewsList,
    children: [
      {path: '', component: HotNews},
      {path:'cate/:id', component:cateNews}
    ]
  },
  {
    path:'/news',
    component: newsHeader,
    children: [
      {path:':id',component: newsDetail}
    ]
  },
  {
    path:'/comments/:id',
    component:Comments
  },
  {
    path:'/editors/:id',
    component:Editors
  },
  {
    path:'/recommenders/:id',
    component:Recommenders
  },
  {
    path:'/editor-detail/:id',
    component:EditorDetail
  },
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
